package com.googlecode.objectify.test.dataloader;

import java.util.ArrayList;

/**
 * A singleton register of entities for Objectify.
 * @author Shakil Siraj
 */
public enum EntitiesRegister {

    /**
     * The singleton instance.
     */
    INSTANCE;
    /**
     * ArrayList that contains the registered entities.
     */
    private ArrayList<Object> entitiesList = new ArrayList<Object>();

    /**
     * Checks if the entity is already registered.
     * @param entity The entity to check
     * @return true if entity is already registered, false otherwise
     */
    public boolean contains(final Object entity) {
	return entitiesList.contains(entity);
    }

    /**
     * Add the entity to the entity list.
     * @param entity the entity to register
     */
    public void add(final Object entity) {
	entitiesList.add(entity);
    }
}
